<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:t="http://myfaces.apache.org/tomahawk"
	xmlns:p="http://primefaces.org/ui">
	
<h:head>
	<h:outputStylesheet library="css" name="main.css" />
</h:head>

<h:body>
<ui:composition template="/template/default.xhtml">
	<ui:define name="no_form">
	<h:outputScript name="locales.js" library="js"/> 
	<h:form enctype="multipart/form-data">

	<t:saveState value="#{prescricaoMB.paciente}" />
		
	<h2>#{msgs.atualizarTabela}</h2>
		
	<h:outputText value="#{msgs.informeTabelaSUS}"/>
		
    <t:inputFileUpload id="fileUploadTabelaProcedimentos" value="#{administracaoMB.tabelaProcedimentos}" required="false"/>
   
	<h:panelGrid columns="1">
		
		 <h:commandButton value="#{msgs.atualizarTabelaBotao}" action="#{administracaoMB.uploadTabelaProcedimentos}" />
		
	</h:panelGrid>
	
	<h2>#{msgs.atualizarCid}</h2>
		
	<h:outputText value="#{msgs.informeCid}"/>
		
    <t:inputFileUpload id="fileUploadCid" value="#{administracaoMB.cid}" required="false"/>
   
	<h:panelGrid columns="1">
		
		 <h:commandButton value="#{msgs.atualizarTabelaBotao}" action="#{administracaoMB.uploadCid}" />
		
	</h:panelGrid>
	
	<h2>#{msgs.adicionarUsuario}</h2>
	
	<h:panelGrid columns="2">
	
	<p:outputLabel value="#{msgs.usuario}" for="usuario" />  
    <p:autoComplete 
            	id="usuario" 
            	dropdown="true"
            	forceSelection="true"
            	value="#{administracaoMB.usuario}"   
                completeMethod="#{administracaoMB.usuarioAutocomplete}"
                maxResults="10"
                minQueryLength="3"
                size="80"
                var="usuario"
                itemLabel="#{usuario.autocomplete}"
                itemValue="#{usuario}"
                required="false"
    />
    
    <p:outputLabel value="#{msgs.tipo}" for="tipo" />    
	<p:selectOneRadio 
				id="tipo" 
				value="#{administracaoMB.tipo}" 
				layout="lineDirection" 
				required="false">
               	
			<f:selectItem itemValue="MEDICO" itemLabel="#{msgs.medico}"/> 
			<f:selectItem itemValue="ADMIN_FORMULARIOS" itemLabel="#{msgs.admin}"/>
		</p:selectOneRadio>
	
	</h:panelGrid>
	
	<h:commandButton value="#{msgs.adicionar}" action="#{administracaoMB.adicionar}" />
	
	<br/>
	<br/>
	
	<h:commandButton 
				action="pacientes" 
				value="#{msgs.voltarPaginaInicial}" 
				immediate="true"/>
	
	
	
	</h:form>
	</ui:define>
</ui:composition>
	
</h:body>
</html>